package ioStream2;

import java.io.*;

public class Stream2 {
	
	public static byte[] getInput() throws Exception{
		System.out.println("Enter some characters: ");
		byte[] buffer = new byte[12];
		for(int i=0 ; i<12 ; i++)
			buffer[i] = (byte) System.in.read();
		return buffer;
	}
	public static void main(String[] args) throws Exception{
		byte buf[] = getInput();
		OutputStream f0 = new FileOutputStream("file1.txt");
		OutputStream f1 = new FileOutputStream("file2.txt");
		OutputStream f2 = new FileOutputStream("file3.txt");
		for(int i=0 ; i<buf.length ; i++){ f0.write(buf[i]); }
		f0.close();
		f1.write(buf);f1.close();
		f2.write(buf,(buf.length)/4, (buf.length)/2);
	}
}
